<template>
	<div class="video-monitor-box">
		<div class="box-title">
			电动自行车入户警戒实时抓拍
		</div>
		<div class="monitor-box">
			<template v-for="(item,index) in dataImage" :key="index">
				<div class="monitor-box-item">
					<img :src="item.catch ? item.catch.image : require('@/assets/images/123.jpg')" alt="">
				</div>
			</template>
		</div>
	</div>
</template>

<script>
	import API from '@/api/index.js'
	export default {
		data() {
			return {
				dataImage: [],
			}
		},
		mounted() {
			this.getData();
		},
		methods: {
			getData() {
				let self = this;
				API.addressRealtimeAlert('', 1).then(res => {
					if (res.data.data.length > 0) {
						self.dataImage = res.data.data;
						self.dataImage.forEach(item => {
							if (!item.catch) {
								item.catch = {
									image: ''
								}
							}
							
							if (!item.catch.image) {
								item.catch.image = ''
							}
						})
						self.dataImage = self.dataImage;
					} else {
						self.dataImage = [];
					}
				})
			}
		}
	}
</script>

<style>
</style>
